home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIFilePicker.idl < prev    next >
Text File  |  2006-05-08  |  5KB  |  157 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * ***** BEGIN LICENSE BLOCK *****
  4.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5.  *
  6.  * The contents of this file are subject to the Mozilla Public License Version
  7.  * 1.1 (the "License"); you may not use this file except in compliance with
  8.  * the License. You may obtain a copy of the License at
  9.  * http://www.mozilla.org/MPL/
  10.  *
  11.  * Software distributed under the License is distributed on an "AS IS" basis,
  12.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13.  * for the specific language governing rights and limitations under the
  14.  * License.
  15.  *
  16.  * The Original Code is the Mozilla browser.
  17.  *
  18.  * The Initial Developer of the Original Code is
  19.  * Netscape Communications Corporation.
  20.  * Portions created by the Initial Developer are Copyright (C) 1999
  21.  * the Initial Developer. All Rights Reserved.
  22.  *
  23.  * Contributor(s):
  24.  *   Stuart Parmenter <pavlov@netscape.com>
  25.  *
  26.  * Alternatively, the contents of this file may be used under the terms of
  27.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  28.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  29.  * in which case the provisions of the GPL or the LGPL are applicable instead
  30.  * of those above. If you wish to allow use of your version of this file only
  31.  * under the terms of either the GPL or the LGPL, and not to allow others to
  32.  * use your version of this file under the terms of the MPL, indicate your
  33.  * decision by deleting the provisions above and replace them with the notice
  34.  * and other provisions required by the GPL or the LGPL. If you do not delete
  35.  * the provisions above, a recipient may use your version of this file under
  36.  * the terms of any one of the MPL, the GPL or the LGPL.
  37.  *
  38.  * ***** END LICENSE BLOCK ***** */
  39.  
  40. #include "nsISupports.idl"
  41.  
  42. interface nsILocalFile;
  43. interface nsIFileURL;
  44. interface nsIDOMWindow;
  45. interface nsISimpleEnumerator;
  46.  
  47. [scriptable, uuid(80faf095-c807-4558-a2cc-185ed70754ea)]
  48. interface nsIFilePicker : nsISupports
  49. {
  50.   const short modeOpen        = 0;              // Load a file or directory
  51.   const short modeSave        = 1;              // Save a file or directory
  52.   const short modeGetFolder   = 2;              // Select a folder/directory
  53.   const short modeOpenMultiple= 3;              // Load multiple files
  54.  
  55.   const short returnOK        = 0;              // User hit Ok, process selection
  56.   const short returnCancel    = 1;              // User hit cancel, ignore selection
  57.   const short returnReplace   = 2;              // User acknowledged file already exists so ok to replace, process selection
  58.  
  59.   const long filterAll        = 0x01;           // *.*
  60.   const long filterHTML       = 0x02;           // *.html; *.htm
  61.   const long filterText       = 0x04;           // *.txt
  62.   const long filterImages     = 0x08;           // *.png; *.gif; *.jpg; *.jpeg
  63.   const long filterXML        = 0x10;           // *.xml
  64.   const long filterXUL        = 0x20;           // *.xul
  65.   const long filterApps       = 0x40;           // Applications (per-platform implementation)
  66.  
  67.  /**
  68.   * Initialize the file picker widget.  The file picker is not valid until this
  69.   * method is called.
  70.   *
  71.   * @param      parent   nsIDOMWindow parent.  This dialog will be dependent
  72.   *                      on this parent. parent must be non-null.
  73.   * @param      title    The title for the file widget
  74.   * @param      mode     load, save, or get folder
  75.   *
  76.   */
  77.   void init(in nsIDOMWindow parent, in AString title, in short mode);
  78.  
  79.  /**
  80.   * Append to the  filter list with things from the predefined list
  81.   *
  82.   * @param      filters  mask of filters i.e. (filterAll | filterHTML)
  83.   *
  84.   */
  85.   void appendFilters(in long filterMask);
  86.  
  87.  /**
  88.   * Add a filter
  89.   *
  90.   * @param      title    name of the filter
  91.   * @param      filter   extensions to filter -- semicolon and space separated
  92.   *
  93.   */
  94.   void appendFilter(in AString title,
  95.                     in AString filter);
  96.  
  97.  /**
  98.   * The filename that should be suggested to the user as a default.
  99.   *
  100.   * @throws NS_ERROR_FAILURE on attempts to get
  101.   */
  102.   attribute AString defaultString;
  103.  
  104.  /**
  105.   * The extension that should be associated with files of the type we
  106.   * want to work with.  On some platforms, this extension will be
  107.   * automatically appended to filenames the user enters, if needed.  
  108.   */
  109.   attribute AString defaultExtension;
  110.   
  111.  /**
  112.   * The filter which is currently selected in the File Picker dialog
  113.   *
  114.   * @return Returns the index (0 based) of the selected filter in the filter list. 
  115.   */
  116.   attribute long filterIndex;
  117.  
  118.  /**
  119.   * Set the directory that the file open/save dialog initially displays
  120.   *
  121.   * @param      displayDirectory  the name of the directory
  122.   *
  123.   */
  124.   attribute nsILocalFile displayDirectory;
  125.  
  126.  
  127.  /**
  128.   * Get the nsILocalFile for the file or directory.
  129.   *
  130.   * @return Returns the file currently selected
  131.   */
  132.   readonly attribute nsILocalFile file;
  133.  
  134.  /**
  135.   * Get the nsIFileURL for the file or directory.
  136.   *
  137.   * @return Returns the file currently selected
  138.   */
  139.   readonly attribute nsIFileURL fileURL;
  140.  
  141.  /**
  142.   * Get the enumerator for the selected files
  143.   * only works in the modeOpenMultiple mode
  144.   *
  145.   * @return Returns the files currently selected
  146.   */
  147.   readonly attribute nsISimpleEnumerator files;
  148.  
  149.  /**
  150.   * Show File Dialog. The dialog is displayed modally.
  151.   *
  152.   * @return returnOK if the user selects OK, returnCancel if the user selects cancel
  153.   *
  154.   */
  155.   short show();
  156. };
  157.